﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ARA.Domain
{
    public class ARADbContext : DbContext
    {
        public ARADbContext()
            :base("name=ara-db")
        {
            Database.SetInitializer<ARADbContext>(null);
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity<Entities.Batch>().ToTable("t_ara_batch");
            modelBuilder.Entity<Entities.Batch>().HasKey(p => p.Id);

            modelBuilder.Entity<Entities.Record>().ToTable("t_ara_record");
            modelBuilder.Entity<Entities.Record>().HasKey(p => p.Id);

            modelBuilder.Entity<Entities.Department>().ToTable("t_ara_department");
            modelBuilder.Entity<Entities.Department>().HasKey(p => p.Id);

            modelBuilder.Entity<Entities.Person>().ToTable("t_ara_person");
            modelBuilder.Entity<Entities.Person>().HasKey(p => p.Id);
        }
    }
}
